/****************************************************************************
 * Copyright (c) 2008, 2009 Andreas Unger and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Andreas Unger - initial API and implementation 
 ****************************************************************************/

package org.eclipselabs.damos.simulation;

import org.eclipselabs.damos.dml.Component;
import org.eclipselabs.damos.dml.DataType;
import org.eclipselabs.damos.dml.InputPort;
import org.eclipselabs.damos.dml.OutputPort;
import org.eclipselabs.damos.execution.executionmodel.Node;

/**
 * @author Andreas Unger
 *
 */
public abstract class AbstractComponentSimulationObject implements ComponentSimulationObject {
	
	private Node node;
	private SimulationContext context;
	
	public final Node getNode() {
		return node;
	}
	
	public void setNode(Node node) {
		this.node = node;
	}
	
	public Component getComponent() {
		return node.getComponent();
	}
	
	public final SimulationContext getContext() {
		return context;
	}
	
	public final void setContext(SimulationContext context) {
		this.context = context;
	}
	
	public void initialize() throws SimulationException {
	}
	
	public void reset() throws SimulationException {
	}
	
	public void consumeInputValue(InputPort inputPort, Value value) throws SimulationException {
	}
	
	public void computeOutputValues() throws SimulationException {
	}

	public Value getOutputValue(OutputPort outputPort) throws SimulationException {
		return null;
	}
	
	public void update() throws SimulationException {
	}
		
	protected final DataType getComponentDataType() {
		return node.getDataType();
	}
	
}